package com.five.api.service.impl;

import com.five.api.dao.ChapterMapper;
import com.five.api.service.ChapterService;
import com.five.entity.Chapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author: star
 * @Date: 2021-05-21 14:08
 * 课程章节 service层实现类
 */
@Service
public class ChapterServiceImpl implements ChapterService {

    @Autowired
    private ChapterMapper chapterMapper;

    @Override
    @Transactional
    public int updateViewCount(long id) {
        Chapter chapter = chapterMapper.findById(id);
        return chapterMapper.updateViewCount(chapter);
    }
}
